package cn.zhaoyuening.crm.web.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public abstract class BaseAction<T> extends ActionSupport {
	
	//分页信息
	//分页大小(default value 20)
	private int pageSize = 20;
	//当前页码
	private int pageNum = 1;
	//总页数
	private int totalPage;
	
	//简化值栈操作
	public void putSession(String key,Object value){
		ActionContext.getContext().getSession().put(key, value);
	}
	public void setValueStack(String key,Object value){
		ActionContext.getContext().getValueStack().set(key, value);
	}
	public void pushValueStack(Object object){
		ActionContext.getContext().getValueStack().push(object);
	}
	public void putContext(String key,Object value){
		ActionContext.getContext().put(key, value);
	}
	public void putApplication(String key,Object value){
		ActionContext.getContext().getApplication().put(key, value);
	}
	
	
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getPageNum() {
		return pageNum;
	}
	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}
	public int getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	
	
}
